#include "slave.h"
#include "coid/comm/binstream/stdstream.h"
#include "coid/comm/binstream/binstream.h"

CSlave::CSlave()
{

}

// In coidized version here we use accept_connect for this functionality from constructor
net_fnc_s opcd CSlave::accept_connect(const charstr &ip, uint oid)
{
   masterThread = new CMaster_client;
   coid::stdoutstream __s; 
   // connect to coid server and submit '1' as constructor (accept_connect_shared) parameter  
   opcd e = masterThread->connect_shared( oid, ip.ptr());
   __s << opcd_formatter(e) << BINSTREAM_FLUSH;
   return 0;
}

net_fnc opcd CSlave::insertSlaveMessage(net_in int value)
{
   printf("Slave insertSrMessage called with: %d\n", value);
   return 0;
}
